package com.devs.squaremenudemo;

import com.devs.squaremenu.SquareMenu;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.agp.utils.Color;
import ohos.app.Context;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class ExampleOhosTest {

    Context context;
    private static int FAB_COLOR = Color.RED.getValue();
    private static String MENU_DIRECTION = "top_left";

    @Test
    public void testBundleName() {
        final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
        assertEquals("com.devs.squaremenudemo", actualBundleName);
    }

    @Test
    public void shouldsetMenuOpenDirection() {
        SquareMenu squareMenu = new SquareMenu(context);
        squareMenu.setMenuOpenDirection(MENU_DIRECTION);
        assertEquals("top_left",squareMenu.getMenuOpenDirection());
    }

    @Test
    public void shouldsetFabColor() {
        SquareMenu squareMenu = new SquareMenu(context);
        squareMenu.setFABColor(new Color(FAB_COLOR));
        assertEquals(Color.RED.getValue(),squareMenu.getFABColor());
    }

}